<%--
  Created by IntelliJ IDEA.
  User: 82387
  Date: 2018/10/12
  Time: 15:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/jsp/meta.jsp"%>
<html>
<head>
</head>
<body>
<form id="sameEditWage">
<table cellpadding="0" cellspacing="0" class="table_form">
    <!--普通表单填写表格使用table_form-->
    <colgroup>
        <col style="width: 50px;"/>
        <col style="width: 100px;"/>
    </colgroup>
    <!--表单表格宽度控制使用colgroup，每个col对应下方的一个td，或者th，上下是对齐的-->
    <thead></thead>
    <!--表头-->
    <tbody>
    <!--表内容，th是蓝色字体，主要放字段名，td为字段内容-->
    <tr>
        <th>类型:</th>
        <td>
            <input name="type" class="easyui-combobox" data-options="
             panelHeight:'auto',
             prompt: '---请选择---',
		valueField: 'label',
		textField: 'value',
		data: [{
			label: '1',
			value: '通项增加'
		},{
			label: '2',
			value: '同向减少'
		}]"/>


        </td>
    </tr>
    <tr>
        <th >月份:</th>
        <td><input type="text" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM'})" name="sysDate" /></td>
    </tr>
    <tr>
        <th >所属部门:</th>
        <td>
            <input class="easyui-combobox" name="deptId"
                   data-options="prompt: '---请选择---',panelHeight:'auto',valueField:'id',textField:'departName',url:'${ctx}/dept/getConomboxForAll'"/>
        </td>
    </tr>

    <tr>
        <th >工资项:</th>
        <td>
            <input class="easyui-combobox" name="detail" data-options="
             panelHeight:'auto',prompt: '---请选择---',
		valueField: 'label',
		textField: 'value',
		data: [{
			label: 'uesrBasicwage',
			value: '基本工资'
		},
		{
			label: 'userSalaryscale',
			value: '薪级工资'
		}
		,
		{
			label: 'userMiles',
			value: '里程补贴'
		}
		,
		{
			label: 'userMisuse',
			value: '误餐补助'
		}
		,
		{
			label: 'userOvertimepay',
			value: '加班费'
		}
		,
		{
			label: 'userOrther1',
			value: '其他1'
		}
		,
		{
			label: 'userSocialsecurity',
			value: '社保费'
		}
		,
		{
			label: 'userAccumulation',
			value: '公积金'
		}
		,
		{
			label: 'userAbsenteeism',
			value: '缺勤扣发'
		},
		{
			label: 'userOther2',
			value: '其他2'
		}
		]"/>

        </td>
    </tr>
    <tr>
        <th>金额:</th>
        <td>
            <input id="ss" class="easyui-numberspinner" name="money"
                   data-options="min:0,max:9999,editable:true,precision:2, prompt:0.00">
        </td>
    </tr>
    </tbody>
</table>
</form>
<div style="text-align: center; margin-top:15px;">
    <a href="javascript:void(0);" class="a_blue btn_op" id="saveSameEdit"><em>保存</em></a>
</div>
<script type="text/javascript">
    //表单验证
    $("#sameEditWage").validate({
        rules:{
            type:{required: true},
            deptId:{required: true},
            detail:{required: true},
            money:{required: true},
            sysDate:{required: true}
        }
    });
    $("#saveSameEdit").click(function () {
        if(!$("#sameEditWage").validate().form()){
            return false;
        }
        ajaxLoading();
        $.post("${ctx}/wage/sameEdit",$("#sameEditWage").serialize(),function (data) {
            ajaxLoadEnd();
            if(data.success){
                $.messager.alert('提示','操作成功');
                $('#openDialog').window("close");
                $("#wageList").datagrid('reload');
            }else {
                $.messager.alert('提示',"操作失败");
            }
        });
    });
</script>
</body>
</html>
